Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache locales to avoid allocations #952

Merged
merged 1 commit into from
Jan 13, 2022
Merged

Cache locales to avoid allocations #952

merged 1 commit into from
Jan 13, 2022

Conversation

Pablete1234
Copy link
Member

parseLocale creates a new locale, and that internally calls intern for al lthe strings. it takes a significant hit in translating stuff and is the majority of the cpu time taken for scoreboard rendering.

This is a profile where you can see the overall time to render the scoreboard, and highlighted in red how long parsing locales takes, most of it being String#intern called on the locale allocation. The 2 columns correspond to translateLegacy and renderGoal calls respectively

img

@Pablete1234 Pablete1234 requested a review from Electroid as a code owner January 7, 2022 03:03
Electroid
Electroid previously approved these changes Jan 7, 2022
@Electroid
Copy link
Member

@Pablete1234 LGTM. Mind fixing the formatting?

@Pablete1234
Copy link
Member Author

had ran the formatter on core instead of in the root PGM, and this was in util 😅 , should be good to go now

@Pablete1234 Pablete1234 requested a review from Electroid January 10, 2022 04:37
@Electroid Electroid merged commit 6473510 into dev Jan 13, 2022
@Electroid Electroid deleted the locale-allocation-fix branch January 13, 2022 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants